<template>
	<h2>资产标签打印设置</h2>
	<el-form-item :label="model[globalparam.labelPrintImportTemplate.paramCode].paramName">
		<ex-widget :model="model[globalparam.labelPrintImportTemplate.paramCode]" size="small" :column="{widgetType:'file',code:'paramValue',height:1}"></ex-widget>
	</el-form-item>

	<el-form-item :label="model[globalparam.labelPrintTemplate.paramCode].paramName">
		<template v-for="item in labelPrintStyles">
			<div style="float:left;margin-left: 20px;">
				<ex-label code="LABEL_PRINT_STYLE" :value="item.value"></ex-label>
				<ex-widget :model="model[globalparam.labelPrintTemplate.paramCode].paramValue" size="small" :column="{widgetType:'file',code:item.value,height:1}"></ex-widget>
			</div>
		</template>
	</el-form-item>

	<el-form-item :label="model[globalparam.defaultSelectNumber.paramCode].paramName">
		<el-input type="number" clearable v-model="model[globalparam.defaultSelectNumber.paramCode].paramValue"/>
	</el-form-item>
</template>

<script>

import globalparam from "@/constant/model/globalparam";
import ExLabel from "@/components/exLabel/index.vue";
import ExFormItem from "@/components/exFormItem/index.vue";
import ExWidget from "@/components/exFormItem/widget.vue";

export default {
	name: 'printTagSetting',
	computed: {
		globalparam() {
			return globalparam
		}
	},
	components: {ExWidget, ExFormItem, ExLabel},
	props: {
		model: {type: Object, default: {}}
	},
	data() {
		return {
			params: [
				globalparam.labelPrintTemplate,
				globalparam.labelPrintImportTemplate,
				globalparam.defaultSelectNumber,
			],
			labelPrintStyles:[]
		}
	},
	async created() {
		this.params.forEach(item => {
			if (!this.model[item.paramCode]) {
				this.model[item.paramCode] = item;
			}else{
				this.model[item.paramCode].paramName = item.paramName;
			}
		});
		this.labelPrintStyles = await this.$cache.dic.options('LABEL_PRINT_STYLE');
	},
	mounted() {
	},
	methods: {}
}
</script>
